def data=binding.getVariable('data')
def rtdata=[]

data?.each{

    def mp= it.part()
    mp.businessType=it.businessType.part()
    mp.bdCumandoc=[id:it.bdCumandoc.id,pkCubasdoc:[custname:it.bdCumandoc.pkCubasdoc.custname]]
    mp.bdInvmandoc=[id:it.bdInvmandoc.id,pkInvbasdoc:[invname:it.bdInvmandoc.pkInvbasdoc.invname]] ;
    mp.contract=[contractNo:it.contract.contractNo]
    mp.cddw=[id:it.cddw.id,pkCubasdoc:[custname:it.cddw.pkCubasdoc.custname]]
    mp.kzdw=[id:it.kzdw.id,pkCubasdoc:[custname:it.kzdw.pkCubasdoc.custname]]
    mp.ship=it?.ship?.defaultPart()
    mp.sjdw=it?.sjdw?.defaultPart()
    mp.gh=it?.gh?.defaultPart()
    mp.checker=it?.checker?.defaultPart()
    mp.maker=it?.maker?.defaultPart()
    rtdata<<mp
}

//mp.shipdoc = [id:data?.shipdoc?.id,shipname:data?.shipdoc?.shipname]
//mp.cddw = [id:data?.cddw?.id,pkCubasdoc:[id:data?.cddw?.pkCubasdoc?.id,custcode:data?.cddw?.pkCubasdoc?.custcode,custname:data?.cddw?.pkCubasdoc?.custname]]
//mp.businessType = [id:data?.businessType?.id,name:data?.businessType?.name]
//mp['bdCorp'] = [id:data?.bdCorp?.id,unitCode:data?.bdCorp?.unitCode,unitName:data?.bdCorp?.unitName]
//mp.maker=[userRealName:data.maker?.userRealName]
//mp.checker=[userRealName:data.checker?.userRealName]



binding.setVariable('returnValue',rtdata)